var BallView=Class.extend({
	ball:null,
	div:null,
	destroy:function(){
		this.div.remove();
	},
	init:function(ball){
			this.ball=ball;
			this.div=$('<div class="ball" />');
			this.div.css({
				width:(this.ball.r*2)+'px',
				height:(this.ball.r*2)+'px',
                "-webkit-border-radius" : this.ball.r + "px"
			});
			this.updatePosition();
		},
	updatePosition: function(){
                this.div.css({
						'-ms-transform':'rotate('+this.ball.deg+'deg)',
						'-o-transform':'rotate('+this.ball.deg+'deg)',
						'-webkit-transform':'rotate('+this.ball.deg+'deg)',
						'-moz-transform':'rotate('+this.ball.deg+'deg)',
                        left:this.ball.x-this.ball.r,
                        top:this.ball.y-this.ball.r,
                });
    }	
});